package com.lkd.feign.fallback;

import com.lkd.entity.ChannelEntity;
import com.lkd.feign.ChannelService;
import com.lkd.feign.TaskService;
import com.lkd.vo.UserWorkVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ChannelServiceFallbackFactory implements FallbackFactory<ChannelService> {


    @Override
    public ChannelService create(Throwable throwable) {
        log.error("调用工单服务失败",throwable);

        return new ChannelService() {
            @Override
            public ChannelEntity getChannelInfo(String innerCode, String channelCode) {
                ChannelEntity channelEntity = new ChannelEntity();
                channelEntity.setInnerCode(null);
                channelEntity.setChannelCode(null);
                return channelEntity;
            }
        };
    }
}